<include file="Public/head"/>
 <style>
                                        .grouptd {
                                            position: relative;
                                        }

                                        .group {
                                            display: inline-block;
                                            width: 100%;
                                        }

                                        .groupselect {
                                            position: absolute;
                                            top: 0;
                                            left: 0;
                                            width: 100%;
                                            height: 100%;
                                            border: 0;
                                        }
                                    </style>
<body class="no-skin">
<include file="Public/header"/>
<div class="main-container" id="main-container">
    <script type="text/javascript">
        try {
            ace.settings.check('main-container', 'fixed')
        } catch (e) {
        }
    </script>

    <include file="Public/sidebar"/>
    <div class="main-content">
        <div class="main-content-inner">
            <!-- #section:basics/content.breadcrumbs -->
            <include file="Public/breadcrumbs"/>

            <!-- /section:basics/content.breadcrumbs -->
            <div class="page-content">
                <include file="Public/set"/>

                <!-- /section:settings.box -->
                <div class="row">
	                    <button type="button"  class="btn btn-purple btn-sm pri" onclick='preview(1);'>
	                                    <span class="ace-icon fa fa-print icon-on-right bigger-110"></span>
	                                   		 打印当前页
	                    </button>
	                    <!--startprint1-->
                        <h2 class=" text-center">预约学车财务详情页</h2>
                        <h5>驾校名称：{$name}</h5>
                   		<h5>时&nbsp;&nbsp;间&nbsp;&nbsp;段：{$dateS|date='Y-m-d',###}&nbsp;至&nbsp;{$dateE|date='Y-m-d',###}</h5>
                        <div class="space-4"></div>
                        <div class="row">
                            <form id="form" method="post" action="{:U('del')}">
                                <table class="table table-striped table-bordered table-hover">
                                    <thead>
                                    <tr>
                                        <th class="center">ID</th>
                                        <th class="center">预约者</th>
                                        <th class="center">预约者手机号</th>
                                        <th class="center">教练</th>
                                        <th class="center">教练电话号码</th>
                                        <th class="center">训练场地</th>
                                        <th class="center">车牌号码</th>
                                        <th class="center">学车类别</th>
						                <th class="center">预约日期</th>
                                        <th class="center">时间段</th>
                                        <th class="center">学时</th>
                                        <th class="center">科目类别</th>
                                        <th class="center">类别</th>
                                        <th class="center">价格</th>
                                        <th class="center">是否支付</th>
                                        <th class="center">支付类型</th>
                                        <th class="center">预约者的状态</th>
                                        <th class="center">下单时间</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                   <?php if(!empty($data)){ ?>
                                    <volist name="data" id="val">
                                        <tr>
                                            <td>{$val.id}</td>
                                            <td class="center">
                                                {$val.user_name}
                                            </td>
                                            <td>{$val.user_phone}</td>
                                            <td>{$val.coach_name}</td>
                                            <td>{$val.coach_phone}</td>
                                            <td>{$val.site}</td>
                                            <td>{$val.car_num}</td>
                                            <td>{$val.type}</td>
                                            <td>{$val.day|date="Y-m-d ",###}</td>
                                            <td>{$val.time}</td>
                                            <td>{$val.study_hours}</td>
                                            <td>
                                                <if condition=" $val['course'] eq 1 ">
                                                    科目二
                                                    <else />
                                                    科目三
                                                </if>
                                            </td>
                                            <td>
                                                <if condition=" $val['category'] eq 1 ">
                                                    模拟
                                                    <else />
                                                    普通
                                                </if>
                                            </td>
                                            <td>{$val.price}</td>
                                            <td>
                                                <if condition=" $val['ispay'] eq 1 ">
                                                    已支付
                                                    <else />
                                                    未支付
                                                </if>
                                            </td>
                                            <td>
                                                <if condition=" $val['pay_type'] eq 1 ">
                                                    线上支付
                                                    <else />
                                                    线下支付
                                                </if>
                                            </td>
                                            <td>
                                                <switch name="val['status']" >
                                                    <case value="1"><b>已学习</b></case>
                                                    <case value="2"><b>未学习</b></case>
                                                    <case value="3"><b>取消</b></case>
                                                    <case value="4"><b>过期</b></case>
                                                </switch>

                                            </td>

                                           <td>{$val.add_time|date="Y-m-d H:i:s",###}</td>
                                        </tr>
                                        
                                    </volist>
		                                    <tr>
		                                    	<td colspan='18' align='right'>本页合计：{$totalP}元&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
		                                    </tr>
                                    <?php }else{ ?>
                                    		 <td class='center' colspan='18' style='color:red;'>该时间段没有预约学车！</td>
                                    <?php } ?>
                                    
                                    </tbody>
                                </table>
                            </form>
                            <div class="cf">

                            </div>
                            {$page}
                        </div>
                        <!--endprint1-->
                        <!-- PAGE CONTENT ENDS -->
                    </div><!-- /.col -->
                </div><!-- /.row -->
            </div><!-- /.page-content -->
        </div>
    </div><!-- /.main-content -->
    <include file="Public/footer"/>

</div><!-- /.main-container -->

<include file="Public/footerjs"/>
<!-- inline scripts related to this page -->
<script type="text/javascript">
/*打印 */
function preview(oper) { 
	if (oper < 10) { 
	bdhtml = window.document.body.innerHTML;//获取当前页的html代码 
	sprnstr = "<!--startprint" + oper + "-->";//设置打印开始区域 
	eprnstr = "<!--endprint" + oper + "-->";//设置打印结束区域 
	prnhtml = bdhtml.substring(bdhtml.indexOf(sprnstr) + 18); //从开始代码向后取html 
	prnhtml = prnhtml.substring(0, prnhtml.indexOf(eprnstr));//从结束代码向前取html 
	window.document.body.innerHTML = prnhtml; 
	window.print(); 
	window.document.body.innerHTML = bdhtml; 
	} else { 
	window.print(); 
	}
}

    $(function () {
        $.ajax({
            type:'post',
            url:"{:U('getAreaInfo')}",
            async:false,
            data:'prov',
            dateType:'json',
            success:function(data){

                var data = eval('('+data+')');
                var str = '<option value="" selected >-选择省-</option>';
                if(data.res == 1){
                    for (var i in data.data){
                        str=str+'<option value="'+data.data[i]['id']+'">'+data.data[i]['name']+'</option>';
                    }
                    $("#prov").html(str);
                    $("#dist").html('<option value="" selected >-请选择-</option>');
                }
            }

        });
    })

    function getCity(pre,next){
        var pre= $('#'+pre).val();
        $("#"+next).show();
        $("#dist").html('<option value="" selected >-请选择-</option>');
        $.ajax({
            type:'post',
            url:"{:U('getAreaInfo')}",
            async:false,
            data:{'pid':pre},
            dateType:'json',
            success:function(data){
                var data = eval('('+data+')');
                var str = '<option value="" selected >-请选择-</option>';
                if(data.res == 1){
                    for (var i in data.data){
                        str=str+'<option value="'+data.data[i]['id']+'">'+data.data[i]['name']+'</option>';
                    }

                    $("#"+next).html(str);

                }else{
                    $("#"+next).hide();
                }
            }

        });
    }


    $(function () {
        $(".group").click(function () {
            $(this).addClass('hide');
            $(this).parent().find(".groupselect").removeClass('hide');
        })
        $(".groupselect").on("change", function () {
            var ob = $(this);
            var gid = ob.val();
            var uid = ob.parent().find('.group').attr('val');
            $.get("{:U('update')}?ajax=yes&uid=" + uid + "&gid=" + gid, function (data) {
                var text = ob.find("option:selected").text();
                ob.parent().find(".group").removeClass('hide').html(text);
                ob.addClass('hide');
            });
        })

        $(".check-all").click(function () {
            $(".uids").prop("checked", this.checked);
        });
        $(".uids").click(function () {
            var option = $(".ids");
            option.each(function (i) {
                if (!this.checked) {
                    $(".check-all").prop("checked", false);
                    return false;
                } else {
                    $(".check-all").prop("checked", true);
                }
            });
        });
        $("#submit").click(function () {
            bootbox.confirm({
                title: "系统提示",
                message: "是否要删除所选用户？",
                callback: function (result) {
                    if (result) {
                        $("#form").submit();
                    }
                },
                buttons: {
                    "cancel": {"label": "取消"},
                    "confirm": {
                        "label": "确定",
                        "className": "btn-danger"
                    }
                }
            });
        });
        $(".del").click(function () {
            var url = $(this).attr('val');
            bootbox.confirm({
                title: "系统提示",
                message: "是否要删除该用户?",
                callback: function (result) {
                    if (result) {
                        window.location.href = url;
                    }
                },
                buttons: {
                    "cancel": {"label": "取消"},
                    "confirm": {
                        "label": "确定",
                        "className": "btn-danger"
                    }
                }
            });
        });

<!--  导出未缴费记录----excel表-->

        $("#excel").click(function () {
            var url = "<?PHP echo U('ExcelRecordReport',array('user_name'=>I('user_name'),'user_phone'=>I('user_phone')));?>";
            bootbox.confirm({
                title: "系统提示",
                message: "确认导出Excel表格吗?",
                callback: function (result) {
                    if (result) {
                        window.location.href = url;
                    }
                },
                buttons: {
                    "cancel": {"label": "取消"},
                    "confirm": {
                        "label": "确定",
                        "className": "btn-danger"
                    }
                }
            });
        });



    })
    function sendInfo(){
        $.ajax({
            type:'post',
            url:"{:U('sendInfo')}",
            async:false,
            success:function(data){
                 bootbox.dialog({
                        title: '友情提示：',
                        message: '发送信息成功',
                        buttons: {
                            "success": {
                                "label": "确定",
                                "className": "btn-danger"
                            }
                        }
                    });
            }

        });
    }


    function sou(){
        var coach_name = $('#coach_name').val();
        var param = '';
        if(coach_name){
            param += '/coach_name/'+coach_name;
        }

        location.href="__APP__/Admin/MeetingCarRecord/index"+param+".html";
    }



</script>
</body>
</html>
